xen/arm: Propagate clock-frequency to DOMU if present in the DT timer node
authorJulien Grall <julien.grall@citrix.com>
Fri, 19 Jun 2015 12:41:29 +0000 (13:41 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 25 Jun 2015 09:59:08 +0000 (10:59 +0100)
commit59ccb33c40c84af729d6c4c5042a7962a40e8537
tree9482b953e0da777743f549aff2cdfbaa0090bba0
parentc16485394844976cdb847d3158659cb998c83f91
xen/arm: Propagate clock-frequency to DOMU if present in the DT timer node

When the property "clock-frequency" is present in the DT timer node, it
means that the bootloader/firmware didn't correctly configure the
CNTFRQ/CNTFRQ_EL0 on each processor.

The best solution would be to fix the offending firmware/bootloader,
although it may not always be possible to modify and re-flash it.

As it's not possible to trap the register CNTFRQ/CNTFRQ_EL0, we have
to extend xen_arch_domainconfig to provide the timer frequency to the
toolstack when the property "clock-frequency" is present to the host DT
timer node. Then, a property "clock-frequency" will be created in the guest
DT timer node if the value is not 0.

We could have set the property in the guest DT no matter if the property
is present in the host DT. Although, we still want to let the guest
using CNTFRQ in normal case. After all, the property "clock-frequency"
is just a workaround for buggy firmware.

Also add a stub for fdt_property_u32 which is not present in libfdt <
1.4.0 used by distribution such as Debian Wheezy.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Tested-by: Chris Brand <chris.brand@broadcom.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- ran autogen.sh ]
tools/config.h.in
tools/configure
tools/configure.ac
tools/libxl/libxl_arm.c
tools/libxl/libxl_libfdt_compat.h
xen/arch/arm/domain.c
xen/arch/arm/time.c
xen/arch/arm/vtimer.c
xen/arch/arm/vtimer.h
xen/include/asm-arm/time.h
xen/include/public/arch-arm.h